package cn.bx.bid.dao;

import cn.bx.bid.entity.Professor;
import cn.bx.bid.entity.Project;
import cn.bx.bid.entity.WorkHistory;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheEvict;

import java.util.List;

public interface ProfessorDao {
    public List<Professor> search(@Param("pageNo") int pageNo, @Param("pageSize") int pageSize, @Param("name") String name, @Param("tele") String tele, @Param("idcard") String idcard);
    public int searchTotal(@Param("name") String name, @Param("tele") String tele, @Param("idcard") String idcard);
//abcd
    Professor get(long id);
    //删除指定专家的工作记录，不单独设置historyDao

    /**
     *
     * @param id 专家号
     * @param hisid 历史记录号
     * @return
     */
    @CacheEvict(value = "professor",allEntries = true)
    int delHis(@Param("pid") long id, @Param("hisid") long hisid);

    @CacheEvict(value = "professor",allEntries = true)
    public int batchDel(@Param("ids")long[] ids);

    //增加专家
    @CacheEvict(value = "professor",allEntries = true)
    int addprofessor(Professor professor);

    //修改专家
    int updataprofessor(Professor professor);

    @CacheEvict(value = "professor",allEntries = true)
    int delprofessor(@Param("id") Long id);

    int addHistory(WorkHistory w);
    //根据专家号获得项目信息
    public List<Project> findProjs(long id);

    public List<WorkHistory> getHistory(long id);
    public WorkHistory getOneHistory(long id);
   int  historyupdate(WorkHistory workHistory);


}
